Computer controlled graphics systems are used for displaying graphics objects on a display. These graphics objects are composed of graphics primitive elements ("graphics primitives") that include points, lines, polygons, etc. The graphics primitives can be used to render a 2 dimensional (2-D) image of a three dimensional (3-D) object on a display screen. Texture mapping refers to techniques for adding surface detail to areas or surfaces of these 3-D graphics objects displayed on a 2-D display. Since the original graphics object is 3-D, texture mapping often involves maintaining certain perspective attributes with respect to the surface detail added to the object. Generally, texture mapping occurs by accessing encoded surface detail points or "texels" from a memory storing the surface detail and transferring the surface detail texels to predetermined points of the graphics primitive to be texture mapped. The manner in which the texels are accessed is used to provide the perspective discussed above.
With reference to prior art FIGS. 1A and 1B, a texture map 102 and a display screen 104 are shown. The texture map 102 contains a texture image 103 to be mapped onto an area or surface of a graphics object 105 on the display screen 4. The texture map 102 includes point elements (texels) which reside in a (u, v) texture coordinate space. The texture image 103 is represented in computer memory as a bitmap or other raster-based encoded format. The display screen 104 includes point elements (pixels) which reside in an (x, y) display coordinate space. More specifically, texture mapping operates by applying color or visual attributes of texels of the (u, v) texture map 102 to corresponding pixels of the graphics object 105 on the display screen 104. In texture mapping, color values for pixels in (x, y) display coordinate space are determined based on sampled texture map values. After texture mapping, a version of the texture image 103 is visible on surfaces of the object 5.
Three types of texture mapping are described below, linear, second order homogeneous perspective and second order non-homogeneous perspective. In linear texture mapping, texels of a texture map are generally mapped onto pixels of a 2-D or 3-D graphics object linearly whereby the rate of sampling in texel space with respect to the screen coordinate update rate is constant, e.g., du/dx and du/dy are constant values. In perspective texture mapping, texels of a texture map are generally mapped onto pixels of a 3-D graphics object that is displayed in 2-D space (x, y) wherein the rate of sampling in texel space with respect to the rate of screen coordinate update rate is not constant. Perspective texture mapping features an illusion of depth which is created by varying the sampling rate of the texture map 102 during the normal linearly performed polygon rendering process on the display screen 104. With reference to prior art FIG. 1A and FIG. 1B, the texture image 103 is mapped onto surfaces of a 2-D rendition of the 3-D graphics object 105 on the display screen 104.
With reference to prior art FIG. 2A, a linear texture sampling path 106 is shown in the (u, v) texture coordinate space that is traversed (e.g., "sampled") during texture map sampling. During linear texture map sampling, the texture image 103 is sampled according to path 106 simultaneously with a well known linear polygon rendering process. Path 106 can be represented by a linear equation of u and v. Each texel of the texture map 102 is defined according to (u, v) coordinates. The rates of change of u and v with respect to x and y (e.g., du/dx, du/dy, dv/dx, and dv/dy) of the linear sampling path 106 of FIG. 2A, are constant values for linear texture map sampling.
With reference to FIG. 2B, a second order homogeneous perspective texture sampling path 108 is shown in (u, v) texture coordinate space. The rates of change of u and v with respect to x and y (e.g., du/dx, du/dy, dv/dx, and dv/dy) of the second order homogeneous perspective sampling path 8 are varying values. However, the rates of change of the rates of change of u and v with respect to x and y (e.g., d.sup.2 u/dx.sup.2, d.sup.2 u/dy.sup.2, d.sup.2 v/dx.sup.2, and d.sup.2 v/dy.sup.2) of the second order homogenous perspective sampling path 8 are constant and thus homogenous values. During homogenous second order texture map sampling, the texture map 102 is sampled according to path 108 during the polygon rendering process. Path 108 can be represented by a homogenous second order polynomial equation of u and v.
With reference to Prior Art FIG. 2C, a non-homogenous second order perspective sampling path 110 is shown in (u, v) texture coordinate space. The rates of change of u and v with respect to x and y (e.g., du/dx, du/dy, dv/dx, and dv/dy) along sampling path 110 are varying values. The rates of change of the rates of change of u and v with respect to x and y (e.g., d.sup.2 u/dx.sup.2, d.sup.2 u/dy.sup.2, d.sup.2 v/dx.sup.2, and d.sup.2 v/dy.sup.2) of the second order perspective sampling path 110 are also varying values and non-homogenous (e.g., the second order rate of change of u is defined by multiple functions of v). During non-homogenous second order texture map sampling, the texture map 102 is sampled according to path 110 during the polygon rendering process. Path 110 can be represented by a non-homogenous second order non-homogenous polynomial equation of u and v.
In typical prior art second order perspective texture mapping techniques, linear terms are generated and divided by perspective terms to obtain perspective texture map sample coordinates, T(u, v), for a given display coordinate in (x, y) display coordinate space. The coordinates (u, v) can then be used to obtain an attribute value from a texture map, T, according to T(u, v). The relationship below illustrates an exemplary second order perspective texture mapping relationship in which linear terms, Du and Dv, are divided by perspective terms, W(x, y, z), which represent depth, to obtain perspective texture map sample position rates of change, du and dv, EQU (du, dv)=(du/W(x, y, z), dv/W(x, y, z)).
From du and dv, the texture coordinates (u, v) are computed in the prior art.
A problem associated with the above described prior art second order perspective texture mapping technique is that it is costly to implement in terms of processor time and integrated circuit real estate due to the repetitive divide operation. Divide operations are computationally expensive. Thus a need exists for a second order perspective texture mapping apparatus which is not costly to implement in terms of processor time and integrated circuit real estate. What is needed further is an apparatus for second order perspective texture mapping that eliminates the repetitive division operation required by prior art texture mapping techniques.
Accordingly, the present invention provides a circuit for efficiently performing non-homogeneous second order texture mapping functions without the need of a divide operation. These and other advantages of the present invention not described above will become clear in view of the following detailed description of the present invention.